#include "Context.h"
#include "StateManager.h"

namespace BPL
{
Context::Context() : mpt_run(true), mpt_stateManager(new StateManager)
{
    mpt_stateManager->setParent(this);
}

Context::~Context()
{

}

void Context::launch()
{
    while(mpt_run)
    {
        mpt_stateManager->update(0.1);
        quit();
    }
}

void Context::quit()
{
    mpt_run = false;
}

const boost::scoped_ptr<StateManager>& Context::getStateManager()
{
    return mpt_stateManager;
}

const boost::shared_ptr<EventObservable>& Context::getInput() const
{
	return mpt_input;
}

}
